/* 新闻聚合系统 - 自定义样式 */

/* Font Awesome 备用图标样式 */
.fa-fallback::before {
    content: '●';
    font-family: Arial, sans-serif;
}

/* 基础工具类样式 */
.content-auto {
    content-visibility: auto;
}

.text-shadow {
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
}

.page-content {
    transition: opacity 0.3s ease;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 文章内容区域样式 */
.full-content-area {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.full-content-area p {
    margin-bottom: 1em;
    line-height: 1.7;
}

.full-content-area img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 1em 0;
    display: block;
}

.full-content-area h1,
.full-content-area h2,
.full-content-area h3,
.full-content-area h4,
.full-content-area h5,
.full-content-area h6 {
    font-weight: 600;
    margin: 1.5em 0 0.5em 0;
    color: #1f2937;
}

.full-content-area blockquote {
    border-left: 4px solid #165DFF;
    padding-left: 1em;
    margin: 1em 0;
    color: #6b7280;
    font-style: italic;
}

.full-content-area a {
    color: #165DFF;
    text-decoration: underline;
}

.full-content-area a:hover {
    color: #1d4ed8;
}

/* 搜索相关样式 */
.search-highlight {
    background-color: #fff3cd;
    color: #856404;
    padding: 1px 2px;
    border-radius: 2px;
    font-weight: 500;
}

.search-suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.search-suggestion-item:hover {
    background-color: #f8f9fa;
}

.search-suggestion-item:last-child {
    border-bottom: none;
}

.search-tag {
    display: inline-block;
    padding: 4px 8px;
    background-color: #f0f4ff;
    color: #165DFF;
    border-radius: 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.search-tag:hover {
    background-color: #165DFF;
    color: white;
}

/* 分类按钮样式 */
.category-btn {
    position: relative;
    overflow: hidden;
}

.category-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.category-btn:hover::before {
    left: 100%;
}

/* 导航栏分类按钮样式 */
.nav-category-btn {
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
    font-size: 0.75rem;
    line-height: 1rem;
    min-width: 40px;
    white-space: nowrap;
}

.nav-category-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.nav-category-btn.active {
    background-color: #165DFF !important;
    color: white !important;
    border-color: #165DFF;
}

.nav-category-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.3s;
}

.nav-category-btn:hover::before {
    left: 100%;
}

/* 内容截断提示样式 */
.content-truncation-notice {
    margin: 1em 0;
    padding: 0.8em;
    background-color: #f8f9fa;
    border-left: 4px solid #165DFF;
    color: #6b7280;
    font-style: italic;
}

/* 外部链接样式 */
.external-link {
    position: relative;
    padding-right: 1.2em;
}

.external-link::after {
    content: '↗';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8em;
    color: #165DFF;
    opacity: 0.7;
}

/* 图片懒加载过渡效果 */
.full-content-area img {
    transition: opacity 0.3s ease;
    opacity: 0;
}

.full-content-area img[loading="lazy"] {
    opacity: 1;
}

/* Font Awesome 图标修复 */
.fa:before { 
    font-family: FontAwesome !important;
}

/* 当 Font Awesome 加载失败时的备用样式 */
.fa-heart:before { content: '♥' !important; }
.fa-heart-o:before { content: '♡' !important; }
.fa-newspaper-o:before { content: '📰' !important; }
.fa-bars:before { content: '☰' !important; }
.fa-angle-right:before { content: '›' !important; }
.fa-angle-left:before { content: '‹' !important; }
.fa-caret-down:before { content: '▼' !important; }
.fa-sign-out:before { content: '→' !important; }
.fa-magic:before { content: '✨' !important; }
.fa-lock:before { content: '🔒' !important; }
.fa-spinner:before { content: '↻' !important; }
.fa-check:before { content: '✓' !important; }
.fa-times:before { content: '×' !important; }
.fa-search:before { content: '🔍' !important; }
.fa-sliders:before { content: '☰' !important; }
.fa-external-link:before { content: '↗' !important; }
.fa-calendar:before { content: '📅' !important; }
.fa-file-text-o:before { content: '📄' !important; }
.fa-weibo:before { content: '微' !important; }
.fa-wechat:before { content: '微' !important; }
.fa-twitter:before { content: 'T' !important; }
.fa-envelope-o:before { content: '✉' !important; }
.fa-phone:before { content: '📞' !important; }
.fa-history:before { content: '⏰' !important; }
.fa-edit:before { content: '✏' !important; }
.fa-arrow-left:before { content: '←' !important; }

/* 高级搜索模态框样式 */
#advanced-search-modal {
    z-index: 9999;
}

#advanced-search-modal .bg-white {
    max-height: 90vh;
    overflow-y: auto;
}

/* 热门搜索列表样式 */
#popular-searches-list {
    max-height: 120px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

#popular-searches-list::-webkit-scrollbar {
    width: 6px;
}

#popular-searches-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

#popular-searches-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

#popular-searches-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 确保模态框内容可滚动 */
.modal-content {
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}